package ArrayTest;

import java.util.Arrays;
import java.util.Random;

public class SelectionSort {
    public static void main(String[] args) {
        int []arr={5,7,3,1,6,9,4,2,8,0};
//        int [] arr=new int[50];
//        for (int i = 0; i < arr.length; i++) {
//            arr[i]=new Random().nextInt(100);
//        }
        System.out.println(Arrays.toString(arr));
        for (int i = 0; i <arr.length-1 ; i++) {
            for (int j = i+1; j <arr.length ; j++) {
                if (arr[i]>arr[j]) {
                    int t;
                    t=arr[i];
                    arr[i]=arr[j];
                    arr[j]=t;
                }
                System.out.println(Arrays.toString(arr));
            }
            System.out.println();
        }
    }
}
